//
//  ZYAlertAction.m
//  TTYL
//
//  Created by apple on 2016/11/11.
//  Copyright © 2016年 乾坤. All rights reserved.
//

#import "ZYAlertAction.h"
#import <objc/runtime.h>
@implementation ZYAlertAction
//按钮标题的字体颜色
-(void)setTextColor:(UIColor *)textColor
{
    _textColor = textColor;
    
    unsigned int count = 0;
    Ivar *ivars = class_copyIvarList([UIAlertAction class], &count);
    for(int i =0;i < count;i ++){
        
        Ivar ivar = ivars[i];
        NSString *ivarName = [NSString stringWithCString:ivar_getName(ivar) encoding:NSUTF8StringEncoding];
        
        if ([ivarName isEqualToString:@"_titleTextColor"]) {
            
            [self setValue:textColor forKey:@"titleTextColor"];
        }
    }
}

@end
